home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 028a / unzup41e.zip / MAKEFILE < prev    next >
Text File  |  1991-05-13  |  15KB  |  372 lines

  1. # Makefile for unzip
  2. #
  3. # ******** INSTRUCTIONS (such as they are) ********
  4. #
  5. # "make vax"    -- makes unzip on a VAX 11-780 BSD 4.3 in current directory
  6. #           (or a SysV VAX, or an 8600 running Ultrix, or...)
  7. # "make"    -- uses environment variable SYSTEM to set the type
  8. #           system to compile for.  This doesn't work for some
  9. #           particularly brain-damaged versions of make (VAX BSD,
  10. #           Gould, and SCO Unix are in this group).
  11. # "make wombat" -- Chokes and dies if you haven't added the specifics
  12. #           for your Wombat 68000 (or whatever) to the systems list.
  13. #
  14. # CFLAGS are flags for the C compiler.  LDFLAGS are flags for the loader.
  15. # LDFLAGS2 are more flags for the loader, if they need to be at the end
  16. # of the line instead of at the beginning.
  17. #
  18. # My host (a VAX 11-780 running BSD 4.3) is hereafter referred to as
  19. # "my host."
  20. #
  21. # My host's /usr/include/sys/param.h defines BSD for me.
  22. # You may have to add "-DBSD" to the list of CFLAGS for your system.
  23. #
  24. # You MAY need to define "-DNOTINT16" if the program produces CRC errors
  25. # during a "-t" run or extraction (this involves structure alignment/padding);
  26. # you MUST define it if your machine is "big-endian" (i.e., it orders bytes
  27. # in Motorola fashion rather than Intel fashion).  The latter case is charac-
  28. # terized by errors of the form "some-kind-of-header signature not found.
  29. # Please report to Info-ZIP." OR a silent do-nothing return with an exit code
  30. # of 51 (EOF).  It should always be safe to define NOTINT16, but it does add
  31. # some overhead, so first try compiling without it and see what happens.
  32. # If death and destruction ensue, it's probably better to go ahead and use
  33. # NOTINT16.
  34. #
  35. # Some versions of make do not define the macro "$(MAKE)" (my host did not).
  36. # The makefile should now handle such systems correctly, more or less; the
  37. # possible exception to this is if you've used a make command-line option
  38. # (for example, the one which displays the commands which WOULD be executed,
  39. # but doesn't actually execute them).  It probably needs some more tinkering.
  40. # If things still don't work, use "make" instead of "$(MAKE)" in your system's
  41. # makerule.  Or try adding the following line to your .login file:
  42. #   setenv MAKE "make"
  43. # (It didn't help on my host.)
  44. #
  45. # memcpy and memset are provided for those systems that don't have them;
  46. # they're found in misc.c and will be used if -DZMEM is included in the list
  47. # of CFLAGS.  These days ALMOST all systems have them (they're mandated by
  48. # ANSI), but older systems might be lacking.  And at least ONE machine's
  49. # version results in some serious performance degradation...
  50. #
  51. # To test your nice new unzip, insure your zip file includes some LARGE
  52. # members.  Many systems ran just fine with zip file members < 512 bytes
  53. # but failed with larger ones.  Members which are "shrunk" rather than
  54. # "imploded" have also caused many problems in the past, so try to test a
  55. # zipfile which contains some of both.  And it's quite possible that this
  56. # program has NEVER been tested on a "reduced" file, so keep your eyes
  57. # open.  (They're probably mythical, though.)
  58.  
  59. #####################
  60. # MACRO DEFINITIONS #
  61. #####################
  62.  
  63. # Defaults most systems use
  64. CC = cc
  65. CFLAGS = -O -DUNIX
  66. LD = cc
  67. LDFLAGS = -o unzip
  68. EXE =
  69. O = .o
  70. OBJS = unzip$O file_io$O mapname$O match$O misc$O\
  71.        unimplod$O unreduce$O unshrink$O
  72.  
  73. SHELL = /bin/sh
  74.  
  75. # list of supported systems in this version
  76. SYSTEMS1 = 386i 3Bx amdahl apollo aviion convex cray cray_cc
  77. SYSTEMS2 = dnix encore generic generic2 gould hp mips msc_dos
  78. SYSTEMS3 = msc_os2 next pyramid rtaix sco sco_dos sequent sgi
  79. SYSTEMS4 = stellar sun tahoe ultrix_risc ultrix_vax vax wombat
  80. # SYSTEMS5 =
  81.  
  82. ####################
  83. # DEFAULT HANDLING #
  84. ####################
  85.  
  86. # The below will try to use your shell variable "SYSTEM" as the type system
  87. # to use (e.g., if you type "make" with no parameters at the command line).
  88. # The test for $(MAKE) is necessary for VAX BSD make (and Gould, apparently),
  89. # as is the "goober" (else stupid makes see an "else ;" statement, which they
  90. # don't like).  "goober" must then be made into a valid target for machines
  91. # which DO define MAKE properly (and have SYSTEM set).  Quel kludge, non?
  92. # And to top it all off, it appears that the VAX, at least, can't pick SYSTEM
  93. # out of the environment either (which, I suppose, should not be surprising).
  94. # [Btw, if the empty "goober" target causes someone else's make to barf, just
  95. # add an "@echo > /dev/null" command (or whatever).  Works OK on the Amdahl
  96. # and Crays, though.]
  97.  
  98. default:
  99.     @if test -z "$(MAKE)"; then\
  100.         if test -z "$(SYSTEM)";\
  101.         then make ERROR;\
  102.         else make $(SYSTEM) MAKE="make";\
  103.         fi;\
  104.     else\
  105.         if test -z "$(SYSTEM)";\
  106.         then $(MAKE) ERROR;\
  107.         else $(MAKE) $(SYSTEM) goober;\
  108.         fi;\
  109.     fi
  110.  
  111. goober:
  112.  
  113. ERROR:
  114.     @echo
  115.     @echo\
  116.  "  If you're not sure about the characteristics of your system, try typing"
  117.     @echo\
  118.  '  "make generic".  If the compiler barfs and says something unpleasant about'
  119.     @echo\
  120.  '  "timezone redefined," try typing "make clean" followed by "make generic2".'
  121.     @echo\
  122.  '  One of these actions should produce a working copy of unzip on most Unix'
  123.     @echo\
  124.  '  systems.  If you know a bit more about the machine on which you work, you'
  125.     @echo\
  126.  '  might try "make list" for a list of the specific systems supported herein.'
  127.     @echo\
  128.  '  And as a last resort, feel free to read the numerous comments within the'
  129.     @echo\
  130.  '  Makefile itself.  Have an excruciatingly pleasant day.'
  131.     @echo
  132.  
  133. list:
  134.     @echo
  135.     @echo\
  136.  'Type "make <system>", where <system> is one of the following:'
  137.     @echo
  138.     @echo  "    $(SYSTEMS1)"
  139.     @echo  "    $(SYSTEMS2)"
  140.     @echo  "    $(SYSTEMS3)"
  141.     @echo  "    $(SYSTEMS4)"
  142. #    @echo  "    $(SYSTEMS5)"
  143.     @echo
  144.     @echo\
  145.  'Otherwise set the shell variable SYSTEM to one of these and just type "make".'
  146.     @echo\
  147.  'For further (very useful) information, please read the comments in Makefile.'
  148.     @echo
  149.  
  150.  
  151. ###############################################
  152. # BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  153. ###############################################
  154.  
  155. .c$O :
  156.     $(CC) -c $(CFLAGS) $*.c
  157.  
  158. unzip$(EXE):    $(OBJS)
  159.     $(LD) $(LDFLAGS) $(OBJS) $(LDFLAGS2)
  160.  
  161. file_io$O:      file_io.c unzip.h
  162. mapname$O:      mapname.c unzip.h
  163. match$O:        match.c unzip.h
  164. misc$O:         misc.c unzip.h
  165. unimplod$O:     unimplod.c unzip.h
  166. unreduce$O:     unreduce.c unzip.h
  167. unshrink$O:     unshrink.c unzip.h
  168. unzip$O:        unzip.c unzip.h
  169.  
  170. clean:
  171.     rm -f $(OBJS) unzip$(EXE)
  172.  
  173. # Zipinfo section commented out because it's no longer compatible with
  174. # the current unzip.h (I think).  Will be updated one of these days...
  175. #
  176. # zipinfo:    zipinfo.c unzip.h
  177. #    $(CC) $(CFLAGS) -DNOTINT16 zipinfo.c -o zipinfo
  178.  
  179.  
  180. ################################
  181. # INDIVIDUAL MACHINE MAKERULES #
  182. ################################
  183.  
  184. # these are the makerules for various systems
  185. # TABS ARE REQUIRED FOR SOME VERSIONS OF make!
  186.  
  187.  
  188. # ---------------------------------------------------------------------------
  189. #   Generic targets (can't assume make utility groks "$(MAKE)")
  190. # ---------------------------------------------------------------------------
  191.  
  192. generic:    # first try for unknown systems:  hope make is called "make"...
  193.     make unzip CFLAGS="$(CFLAGS) -DNOTINT16"
  194.  
  195. generic2:    # second try for unknown systems:  keep hoping...
  196.     make unzip CFLAGS="$(CFLAGS) -DNOTINT16 -DBSD"
  197.  
  198. # ---------------------------------------------------------------------------
  199. #   "Normal" (i.e., PC-like) group (no #defines):
  200. # ---------------------------------------------------------------------------
  201.  
  202. 386i:        unzip    # sun386i, SunOS 4.0.2 ["sun:" works, too, but bigger]
  203. encore:        unzip    # Multimax
  204. sco:        unzip    # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.
  205. ultrix_vax:    unzip    # VAXen running Ultrix (just 4.0?); not RISC machines
  206. vax:        unzip    # general-purpose VAX target (not counting VMS)
  207.  
  208. # ---------------------------------------------------------------------------
  209. #   NOTINT16 (structure-padding and/or big-endian) group:
  210. # ---------------------------------------------------------------------------
  211.  
  212. 3Bx:        _16    # AT&T 3B2/1000-80; should work on any WE32XXX machine
  213. amdahl:        _16    # Amdahl (IBM) mainframe, UTS (SysV) 1.2.4 and 2.0.1
  214. apollo:        _16    # Apollo Domain/OS machines
  215. aviion:         _16     # Data General AViiONs, DG/UX 4.3x
  216. convex:        _16    # C200/C400
  217. cray_cc:    _16    # Cray-2 and Y-MP, using old-style compiler
  218. #dec5820:    _16    # DEC 5820 (RISC), Test version of Ultrix v4.0
  219. dnix:        _16    # 680X0, DIAB dnix 5.2/5.3 (a Swedish System V clone)
  220. gould:        _16    # Gould PN9000 running UTX/32 2.1Bu01
  221. hp:        _16    # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver D
  222. mips:        _16    # MIPS M120-5(?), SysV R3 [error in sys/param.h file?]
  223. #next:        _16    # 68030 BSD 4.3+Mach
  224. rtaix:        _16    # IBM RT 6150 under AIX 2.2.1
  225. stellar:    _16    # gs-2000
  226. tahoe:        _16    # tahoe (CCI Power6/32), 4.3BSD
  227.  
  228. _16:
  229.     $(MAKE) unzip CFLAGS="$(CFLAGS) -DNOTINT16"
  230.  
  231. # ---------------------------------------------------------------------------
  232. #   NOTINT16 + BSD (for timezone structs) group:
  233. # ---------------------------------------------------------------------------
  234.  
  235. sun:        _16bsd    # Sun 4/110, SunOS 4.0.3c; Sun 3 (68020), SunOS 4.0.3
  236. ultrix_risc:    _16bsd    # DEC 58x0 (MIPS guts), DECstation 2100; Ultrix v4.1
  237.  
  238. _16bsd:
  239.     $(MAKE) unzip CFLAGS="$(CFLAGS) -DNOTINT16 -DBSD"
  240.  
  241. # ---------------------------------------------------------------------------
  242. #   "Unique" group (require non-standard options):
  243. # ---------------------------------------------------------------------------
  244.  
  245. # Sequent Symmetry is a 386 but needs -DZMEM
  246. # This should also work on Balance but I can't test it just yet.
  247.  
  248. sequent:    # Sequent w/Dynix
  249.     $(MAKE) unzip CFLAGS="$(CFLAGS) -DNOTINT16 -DBSD -DZMEM"
  250.  
  251. # I have finished porting unzip 3.0 to the Pyramid 90X under OSX4.1.
  252. # The biggest problem was the default structure alignment yielding two
  253. # extra bytes.  The compiler has the -q option to pack structures, and
  254. # this was all that was needed.  To avoid needing ZMEMS we could compile in
  255. # the att universe, but it runs slower!
  256.  
  257. pyramid:    # Pyramid 90X, probably all, under >= OSx4.1, BSD universe
  258.     make unzip CFLAGS="$(CFLAGS) -q -DBSD -DNOTINT16 -DZMEM"
  259.  
  260. # I successfully compiled and tested the unzip program (v30) for the
  261. # Silicon Graphics environment (Personal Iris 4D20/G with IRIX v3.2.2)
  262. #
  263. #  Valter V. Cavecchia          | Bitnet:       cavecchi@itncisca
  264. #  Centro di Fisica del C.N.R.  | Internet:     root@itnsg1.cineca.it
  265. #  I-38050 Povo (TN) - Italy    | Decnet:       itnvax::cavecchia (37.65)
  266.  
  267. sgi:        # Silicon Graphics (tested on Personal Iris 4D20)
  268.     $(MAKE) unzip \
  269.     CFLAGS="$(CFLAGS) -I/usr/include/bsd -DBSD -DNOTINT16" \
  270.     LDFLAGS="-lbsd $(LDFLAGS)"
  271.  
  272. # Cray-2 and Y-MP, running Unicos 5.1.10 or 6.0 (SysV + BSD enhancements)
  273. # and Standard (ANSI) C compiler 1.5 or 2.0.1.
  274.  
  275. cray:
  276.     $(MAKE) unzip CC="scc" LD="scc" CFLAGS="$(CFLAGS) -DNOTINT16"
  277.  
  278. # SCO cross compile from unix to DOS. Tested with Xenix/386 and
  279. # OpenDeskTop. Should work with xenix/286 as well. (davidsen)
  280. # Note that you *must* remove the unix objects and executable
  281. # before doing this!
  282.  
  283. sco_dos:
  284.     $(MAKE) unzip CFLAGS="-O -dos -M0" LDFLAGS="-dos" \
  285.         LDFLAGS2="-o unzip.exe"
  286.  
  287. # PCs (IBM-type), running MS-DOS, Microsoft C 6.00 and NMAKE.  Can't use the
  288. # SYSTEM environment variable; that requires processing the "default:" target,
  289. # which expands to some 200+ characters--well over DOS's 128-character limit.
  290. # "nmake msc_dos" works fine, aside from an annoying message, "temporary file
  291. # e:\ln023193 has been created."  I have no idea how to suppress this, but it
  292. # appears to be benign (comes from the link phase; the file is always deleted).
  293. # The environment variable FP should be set to something appropriate if your 
  294. # library uses other than the default floating-point routines; for example, 
  295. # SET FP=-FPi87 .  "msc_dos:" does NOT work with Dennis Vadura's dmake (dmake 
  296. # doesn't seem to understand quotes, and it wants SHELL=$(COMSPEC).  NMAKE 
  297. # ignores SHELL altogether.)  This target assumes the small-model library and 
  298. # an 80286 or better.  At present, everything fits within the 128-character 
  299. # command-line limit.  (Barely.)
  300.  
  301. msc_dos:
  302.     $(MAKE) -nologo unzip.exe CFLAGS="-Ox -nologo $(FP) -G2" CC=cl\
  303.     LD=link EXE=.exe O=.obj LDFLAGS="/noi /nol" LDFLAGS2=",unzip;"
  304.  
  305. # I do not believe that OS/2 has the 128 character command line limitation, 
  306. # so when I have more time to get to know how nmake really works, I may figure 
  307. # out how to set the makefile so that it works like most of the other things 
  308. # in unix.  The main things I had to change were adding the define -DOS2 and 
  309. # the C flag -Lp.  It still looks for the default named libraries, and not 
  310. # the protected-mode names, but I am sure most people dealing with OS/2 know
  311. # how to type slibcep when it says it can't find slibce.
  312.  
  313. msc_os2:
  314.     $(MAKE) -nologo unzip.exe CFLAGS="-Ox -nologo $(FP) -G2 -DOS2 -Lp"\
  315.     CC=cl LD=link EXE=.exe O=.obj LDFLAGS="/noi /nol"\
  316.     LDFLAGS2=",unzip,,,unzip.def;"
  317.  
  318. # NeXT 2.x: make the executable smaller.
  319. next:
  320.     $(MAKE) unzip CFLAGS="$(CFLAGS) -DNOTINT16" LDFLAGS2="-object -s"
  321.  
  322. # I didn't do this.  I swear.  No, really.
  323.  
  324. wombat:        # Wombat 68000 (or whatever)
  325.     @echo
  326.     @echo  '    Ha ha!  Just kidding.'
  327.     @echo
  328.  
  329. ################
  330. # ATTRIBUTIONS #
  331. ################
  332.  
  333. # Thanks to the following people for their help in testing and/or porting
  334. # to various machines:
  335. #
  336. #  386i:    Richard Stephen, stephen@corp.telecom.co.nz
  337. #  3Bx:        Bob Kemp, hrrca!bobc@cbnewse.att.com
  338. #  amdahl:    Kim DeVaughn, ked01@juts.ccc.amdahl.com
  339. #  apollo:    Tim Geibelhaus
  340. #  aviion:    Bruce Kahn, bkahn@archive.webo.dg.com
  341. #  cray:    Greg Roelofs, roelofs@amelia.nas.nasa.gov
  342. #  dec5820:    "Moby" Dick O'Connor, djo7613@u.washington.edu
  343. #  dnix:    Bo Kullmar, bk@kullmar.se
  344. #  gould:    Onno van der Linden, linden@fwi.uva.nl
  345. #  hp:        Randy McCaskile, rmccask@seas.gwu.edu (HP-UX)
  346. #           Gershon Elber, gershon@cs.utah.edu (HP BSD 4.3)
  347. #  mips:    Peter Jones, jones@mips1.uqam.ca
  348. #  msc_dos:    Greg Roelofs
  349. #  msc_os2:    Wim Bonner, wbonner@yoda.eecs.wsu.edu
  350. #  next:    Mark Adler, madler@piglet.caltech.edu
  351. #  pyramid:    James Dugal, jpd@usl.edu
  352. #  rtaix:    Erik-Jan Vens
  353. #  sco:        Onno van der Linden (SCO Unix 3.2.0)
  354. #           Bill Davidsen, davidsen@crdos1.crd.ge.com (Xenix/386)
  355. #  sco_dos:    Bill Davidsen
  356. #  sequent:    Phil Howard, phil@ux1.cso.uiuc.edu
  357. #  sgi:        Valter V. Cavecchia (see comments for addresses)
  358. #  sun:        Onno van der Linden (Sun 4)
  359. #  tahoe:    Mark Edwards, mce%sdcc10@ucsd.edu
  360. #  ultrix_vax:    Greg Flint, afc@klaatu.cc.purdue.edu
  361. #  ultrix_risc:    Michael Graff, explorer@iastate.edu
  362. #  vax:        Forrest Gehrke, feg@dodger.att.com (SysV)
  363. #        David Kirschbaum, kirsch@usasoc.soc.mil (BSD 4.3)
  364. #        Jim Steiner, steiner@pica.army.mil (8600+Ultrix)
  365. #  wombat:    Joe Isuzu, joe@trustme.isuzu.com
  366.  
  367. # SCO unix 3.2.0:
  368. # Don't use -Ox with cc (derived from Microsoft 5.1), there is
  369. # a bug in the loop optimization, which causes bad CRC's
  370. #
  371. # Onno van der Linden
  372.